import express from 'express'
import cookieSession from 'cookie-session'
import bodyParser from 'body-parser'
import router from './router'
// 让类自动执行一遍 装饰器就会生效
import './controller/LoginController'
import './controller/CrowllerController'
const app = express()
app.use(bodyParser.urlencoded({ extended: false }))
app.use(
  cookieSession({
    name: 'session',
    keys: ['hahahaha'],
    maxAge: 24 * 60 * 60 * 1000, // 24 hours
  })
)
app.use(router)
app.listen(7009, () => {
  console.log('serve is runing at http://localhost:7009')
})
